package com.imooc.miaosha.dao;

import com.imooc.miaosha.domian.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 模块描述: <br>
 * (用户mapper)
 *
 * @Author: Mr. xyb
 * @Date: 2019/4/14 15:21
 * @since: 1.8.0
 * @version: 1.0.0
 */
@Mapper
public interface UserDao {

    /**
     * 根据手机号码查询用户
     *
     * @param id
     * @return
     */
    @Select("select * from miaosha_user where id = #{id}")
    User getUserById(@Param("id") String id);

    /**
     * 插入一条记录（用户信息）
     *
     * @param user
     */
    @Insert("insert into miaosha_user(id,name) values(#{id},#{name})")
    void insert(User user);
}
